package com.zzh.interview.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzh.interview.model.dto.user.UserTDO;
import com.zzh.interview.model.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户数据库操作
 * @author <a href="https://github.com/liyupi">程序员鱼皮</a>
 * @from <a href="https://yupi.icu">编程导航知识星球</a>
 */

@Repository
public interface UserMapper extends BaseMapper<User> {

    @Update("update user set avatarUrl = #{url} where id = #{id};")
    int updateAvaTarUrl(String url,Long id);

    //根据用户账户来查询用户列表
    List<User> selectListByAccount(long parseLong);

    /**
     * 动态判断修改用户那些信息
     * @param userTDO
     * @return
     */
    int updateUserInfoById(@Param("userTDO") UserTDO userTDO);
}




